﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;

namespace SiteAgle
{
    // Note: For instructions on enabling IIS6 or IIS7 classic mode,  
    // visit http://go.microsoft.com/?LinkId=9394801

    public class MvcApplication : System.Web.HttpApplication
    {
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            routes.MapRoute(
           "detalhegrupoPrint",
           "grupotrabalho/print/{id}/{idUser}",
           new { controller = "GrupoTrabalho", action = "print", id = UrlParameter.Optional, idUser = UrlParameter.Optional });


            routes.MapRoute(
                "detalhegrupo",
                "grupotrabalho/grupodetalhe/{id}/{idUser}",
                new { controller = "GrupoTrabalho", action = "GrupoDetalhe", id = UrlParameter.Optional,  idUser = UrlParameter.Optional });

            
            routes.MapRoute(
                "alterarstatus",
                "tarefa/alterarstatus/{idTarefa}/{status}/{idUser}",
                new { controller = "tarefa", action = "AlterarStatus", idTarefa = UrlParameter.Optional, status = UrlParameter.Optional, idUser = UrlParameter.Optional });


            routes.MapRoute(
                "login",
                "login",
                new { controller = "Usuario", action = "Login" });

            routes.MapRoute(
                "sobre",
                "sobre",
                new { controller = "Home", action = "Sobre" });

            routes.MapRoute(
               "tarefa",
               "tarefa",
               new { controller = "tarefa", action = "index", id = UrlParameter.Optional });

            routes.MapRoute(
                "Default", // Route name
                "{controller}/{action}/{id}", // URL with parameters
                new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
            );



        }

        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();

            RegisterRoutes(RouteTable.Routes);
        }
    }
}